3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
A tracker is a kind of QuickDraw 3D object that controls the position, orientation, and button state of a specific element in your application's user interface. QuickDraw 3D always provides a tracker that controls the location and orientation of the system cursor. You can create additional trackers and attach them to other visible elements of your application's user interface. As suggested earlier, you can attach a 3D pointing device to a view's camera and then let users control the camera's position and orientation using the device. If the device has one or more buttons, you could let users turn the lights on and off using those buttons.
This is not necessarily a good human interface for turning lights on and off; it is intended only for illustrative purposes.
All the controllers currently reporting data to a particular tracker, whether absolute or relative, jointly contribute to the button states of the tracker. The button state of a tracker button of a particular index is the logical OR of the button states of all controller buttons of that index.
You can determine that a tracker has moved in one or both of two ways. You can poll for a tracker serial number, which changes every time the coordinates of the tracker are updated by a controller. Or, you can install a tracker notify function that is called whenever the coordinates of a tracker change by more than a specified amount (the tracker thresholds ). Your tracker notify function can respond itself to the change, or it can just wake up your application. These two techniques can also be combined.
Previous | QD3D Book | Overview | Chapter Contents | Next |